package com.sky.mapper;

import com.sky.annotation.AotuFill;
import com.sky.entity.DishFlavor;
import com.sky.entity.SetmealDish;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @version 1.0
 * @Author 郭腾高
 * @Date 2024/9/16 22:55
 */
@Mapper
public interface SetmealDishMapper {

    /**
     * 根据菜品id查询相应套餐信息
     * @param
     * @return
     */
    List<Long> getSetmealIdsByDishId(List<Long> dishIds);
    /**
     * 根据菜品id查询相应套餐信息
     * @param
     * @return
     */
    @Select("select setmeal_id from setmeal_dish where dish_id =#{dishId}")
    Long getSetmealIdsByDishIdOne(Long dishId);
    /*套餐对应的菜品*/
    void insertBach(List<SetmealDish> setmealDishes);

   /*根据套餐id删除对应菜品集合*/
    void deleteBySetmealId(List<Long> ids);


    /*根据套餐id查询菜品集合*/
    @Select("select * from setmeal_dish where setmeal_id = #{id}")
    List<SetmealDish> getListBySeatmealId(Long id);
    /*根据单个套餐id删除对应菜品集合*/
    @Delete("delete from setmeal_dish where setmeal_id = #{id}")
    void deleteBySetmealIdOne(Long id);
}
